package team.bailan.controller.lord;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import team.bailan.common.config.ReturnResponse;
import team.bailan.entity.dto.RoomInfDTO;
import team.bailan.service.LordService;

@RestController
@RequestMapping("api/lord")
public class LordController {
    @Autowired
    private LordService lordService;

    @ApiOperation("获取第一个抢地主的玩家")
    @PostMapping("init")
    public ReturnResponse<String> getInitialRobber(@RequestBody RoomInfDTO roomInfDTO) {
        return lordService.getInitialRobber(roomInfDTO);
    }

    @ApiOperation("抢地主")
    @PostMapping("rob")
    public ReturnResponse<String> robTheLord(@RequestBody RoomInfDTO roomInfDTO) {
        return lordService.robTheLord(roomInfDTO);
    }

    @ApiOperation("不抢地主")
    @PostMapping("not")
    public ReturnResponse<String> doNotRobTheLord(@RequestBody RoomInfDTO roomInfDTO) {
        return lordService.doNotRobTheLord(roomInfDTO);
    }
}
